/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sampleEntity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author ASUS K43E
 */
@Embeddable
public class BillDetailPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "billId", nullable = false)
    private int billId;
    @Basic(optional = false)
    @Column(name = "productId", nullable = false, length = 50)
    private String productId;

    public BillDetailPK() {
    }

    public BillDetailPK(int billId, String productId) {
        this.billId = billId;
        this.productId = productId;
    }

    public int getBillId() {
        return billId;
    }

    public void setBillId(int billId) {
        this.billId = billId;
    }

    public String getProductId() {
        return productId;
    }

    public void setProductId(String productId) {
        this.productId = productId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) billId;
        hash += (productId != null ? productId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof BillDetailPK)) {
            return false;
        }
        BillDetailPK other = (BillDetailPK) object;
        if (this.billId != other.billId) {
            return false;
        }
        if ((this.productId == null && other.productId != null) || (this.productId != null && !this.productId.equals(other.productId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "sampleEntity.BillDetailPK[billId=" + billId + ", productId=" + productId + "]";
    }

}
